<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = new Object();
        obj.say = () => console.log(this);
        obj.say() // window
            ! function() {
                function test2() {
                    this.a = 22;
                    console.log(this);
                    let b = () => {
                        console.log(this.a) // this指向的是test2构造函数实例对象
                    }
                    b();
                }
                new test2();
                let res = new test2();
                console.log(res); // {a:22}
            }
    </script>
</body>

</html>